import pymysql

con = pymysql.connect(host="localhost",user="root",password="root",database="company")

cursor = con.cursor()

sql = "select  * from t_employees  where sal > %s"

param = [8000]

cursor.execute(sql,param)

#  提取数据
data = cursor.fetchmany(6)

for i in data:
    print(i)

cursor.close()
con.close()






